Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for query RBAC to tempomonolithic #1131

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

pavolloffay
Copy link
Collaborator

//
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query Configuration",xDescriptors="urn:alm:descriptor:com.tectonic.ui:advanced"
Query MonolithicQuerySpec `json:"query,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Query MonolithicQuerySpec `json:"query,omitempty"`
Query *MonolithicQuerySpec `json:"query,omitempty"`

In the monolithic CR we use pointers for all structs, because otherwise, writing an empty spec to the cluster and reading it back gives two different YAML objects, like this:

spec:
  query:
    rbac: {}

In the tempomonolithic_defaults.go we fill in the possibly-nil pointers to avoid panics when reading from nil pointers:

if r.Spec.Ingestion == nil {
r.Spec.Ingestion = &MonolithicIngestionSpec{}
}
if r.Spec.Ingestion.OTLP == nil {
r.Spec.Ingestion.OTLP = &MonolithicIngestionOTLPSpec{}
}

// +optional
// +kubebuilder:validation:Optional
// +operator-sdk:csv:customresourcedefinitions:type=spec,displayName="Query RBAC Settings"
RBAC RBACSpec `json:"rbac,omitempty"`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
RBAC RBACSpec `json:"rbac,omitempty"`
RBAC *RBACSpec `json:"rbac,omitempty"`

same as above

@codecov-commenter
Copy link

codecov-commenter commented Feb 24, 2025

Codecov Report

Attention: Patch coverage is 54.54545% with 15 lines in your changes missing coverage. Please review.

Project coverage is 58.56%. Comparing base (796f4d7) to head (b842e99).

Files with missing lines Patch % Lines
api/tempo/v1alpha1/zz_generated.deepcopy.go 0.00% 15 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1131      +/-   ##
==========================================
- Coverage   58.58%   58.56%   -0.02%     
==========================================
  Files         113      113              
  Lines       10213    10246      +33     
==========================================
+ Hits         5983     6001      +18     
- Misses       3922     3937      +15     
  Partials      308      308              
Flag Coverage Δ
unittests 58.56% <54.54%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Signed-off-by: Pavol Loffay <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants